<template>

  <div style="border: 2px #c51a2e solid;width: 500px;height: 300px;margin: 0 auto">
    <h1>这是父组件</h1>
    <MySon :fathername="fathername" :age="age" :sex="sex"></MySon>
    <span @receiveFromSon="receive()" >儿子发来的数据：{{sonData}}</span>
  </div>
</template>

<script>
import MySon from "@/components/MySon.vue";

export default {
  name: "MyFather",
  components: {MySon},
  data() {
    return {
      fathername:"111",
      age:33,
      sex:true,
      sonData:null
    }
  },
  methods: {
    receive(data){
      this.sonData=data;
    }

  }
}
</script>

<style scoped>

</style>